<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目bug</title>
</head>
<body>
    
    <script>
        let arr1 = [
            {
                a: 'a',
                b: ''
            }
        ]

        let arr2 = [
            {
                a: 'a',
                b: 'b'
            }
        ]

        arr1.forEach((item1)=>{
            arr2.forEach((item2)=>{
                if(item1.a === item2.a){
                    console.log('进入循环了');
                    
                    // item1.a=item2.a;
                    // item1.b=item2.b;
                    item1={...item2};
                }
            })
        })

        console.log('arr1',arr1);
        
    </script>
</body>
</html>